﻿<%@ Page Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="ads.aspx.cs" Inherits="admin_ads" Title="Quảng cáo" %>

<%@ Register Assembly="RadUpload.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
    <rad:radgrid id="grdAds" runat="server" autogeneratecolumns="False" enableajax="True"
        gridlines="None" skin="Telerik" LoadingTemplateTransparency="25" OnNeedDataSource="grdAds_NeedDataSource" OnDeleteCommand="grdAds_DeleteCommand" AllowSorting="True" EnableAJAXLoadingTemplate="True">

<MasterTableView NoMasterRecordsText="Kh&#244;ng c&#243; dữ liệu." DataKeyNames="AdID,AdImg">
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <rad:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" UniqueName="column">
        </rad:GridButtonColumn>
        <rad:GridBoundColumn DataField="AdText" HeaderText="Nội dung" UniqueName="AdText">
            <ItemStyle Width="220px" />
        </rad:GridBoundColumn>
        <rad:GridTemplateColumn DataField="AdUrl" HeaderText="Url" UniqueName="AdUrl">
            <ItemTemplate>
                <asp:HyperLink ID="lnkAdUrl" runat="server" NavigateUrl='<%# Eval("AdUrl") %>'
                    Target="_blank" Text='<%# Eval("AdUrl") %>'></asp:HyperLink>
            </ItemTemplate>
            <ItemStyle Width="450px" />
        </rad:GridTemplateColumn>
        <rad:GridCheckBoxColumn DataType="System.Boolean" HeaderText="Ẩn"
            UniqueName="Disabled" DataField="Disabled">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle HorizontalAlign="Center" />
        </rad:GridCheckBoxColumn>
    </Columns>
    <EditFormSettings EditFormType="Template"></EditFormSettings>
</MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
</rad:radgrid>
<br />
    <asp:Button ID="btnSelect" runat="server" CssClass="button" OnClick="btnSelect_Click"
        Text="Chọn" /><br />
<br />
    <table border="0" cellpadding="3" cellspacing="0" style="width: 80%" align="Center">
        <tr>
            <td style="width: 100px">
            </td>
            <td style="width: 280px">
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
            </td>
            <td style="width: 280px">
                <asp:Image ID="imgAdImg" runat="server" Visible="False" />
                <asp:HiddenField ID="txtAdID" runat="server" />
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
                Nội dung:</td>
            <td style="width: 280px">
                <asp:TextBox ID="txtAdText" runat="server" CssClass="admTxt" MaxLength="50" Width="250px"></asp:TextBox></td>
            <td>
                <asp:Label ID="lblTextError" runat="server" CssClass="Verdana8Red" Visible="False">***</asp:Label></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Url:</td>
            <td style="width: 280px">
                <asp:TextBox ID="txtAdUrl" runat="server" CssClass="admTxt" MaxLength="333" Width="250px"></asp:TextBox></td>
            <td>
                <asp:Label ID="lblUrlError" runat="server" CssClass="Verdana8Red" Visible="False">***</asp:Label></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Hình ảnh:</td>
            <td style="width: 280px">
                <rad:RadUpload ID="rup" runat="server" ControlObjectsVisibility="None" Language="vi-VN"
                    LocalizationPath="~/RadControls/Upload/Localization" MaxFileInputsCount="1" ReadOnlyFileInputs="True"
                    Skin="Desert" OnValidatingFile="rup_ValidatingFile" />
            </td>
            <td>
                <asp:Label ID="lblFileError" runat="server" CssClass="Verdana8Red" Visible="False"></asp:Label></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Không hiển thị:</td>
            <td style="width: 280px">
                <asp:CheckBox ID="chkDisabled" runat="server" /></td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
            </td>
            <td style="width: 280px">
                <asp:Button ID="btnAdd" runat="server" CssClass="button" Text="Thêm" OnClick="btnAdd_Click" />&nbsp;
                <asp:Button ID="btnUpdate" runat="server" CssClass="button" Text="Cập nhật" Visible="False" OnClick="btnUpdate_Click" />
                <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="Huỷ" OnClick="btnCancel_Click" Visible="False" /></td>
            <td>
            </td>
        </tr>
    </table>
</asp:Content>

